﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Controls_Header : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
            return;
        cb_search_header.DataSource = new DanhMucDAO().HienThiDanhMucDropDown();
        cb_search_header.DataTextField = "TenDanhMuc";
        cb_search_header.DataValueField = "IDDanhMuc";
        cb_search_header.DataBind();
    }
    protected void btn_search_header_Click(object sender, EventArgs e)
    {
        int id = int.Parse(cb_search_header.SelectedValue);
        Response.Redirect("Default.aspx?act=tim-kiem&id=" + id + "&key=" + txt_search.Text);
    }
}